package evolucija1

class LoginTagLib {

	def loginControl = {
		if(session.user){
		
			if(session.user.role=="admin") {
				out << "Hello ${session.user.korisnickoIme} "
				//out << """[${link(action:"logout", controller:"korisnik"){"Logout"}}]"""
			}
			else if(session.user.role=="anon") {
				out << "Hello user "
				}
			else{
				out << "Hello expert "+ session.user
				//redirect(controller:"korisnik", action:"anon")
				
				}
		} else {
			//out << """[${link(action:"login", controller:"korisnik"){"Login"}}]"""
		}
	}
}
